using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using CMS.Domain.Entity;
using Microsoft.EntityFrameworkCore;

namespace CMS.Infrastructrue.Persistence
{
    public class CMSDbContext:DbContext
    {
        public CMSDbContext(DbContextOptions options) : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            // 应用当前Assembly中定义的所有的Configurations，就不需要一个一个去写了。
            builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());

            base.OnModelCreating(builder);
        }

        
        public DbSet<CMSExceptionLog> CMSExceptionLog =>Set<CMSExceptionLog>();
        public DbSet<CMSAuditLog> CMSAuditLog =>Set<CMSAuditLog>();
        public DbSet<CMSIdentityUser> CMSIdentityUser =>Set<CMSIdentityUser>();



        public DbSet<Users> Users => Set<Users>();
        public DbSet<Register> Register=>Set<Register>();
        public DbSet<AttentionAuthor> AttentionAuthor=>Set<AttentionAuthor>();
        public DbSet<Avatar> Avatar=>Set<Avatar>();
        public DbSet<Blog> Blog=>Set<Blog>();
        public DbSet<BlogCollect> BlogCollect=>Set<BlogCollect>();
        public DbSet<BlogAllText> blogAllText=>Set<BlogAllText>();
        public DbSet<Category> Category	=>Set<Category>();
        public DbSet<Comment> Comment =>Set<Comment>();

    }
}